<!--
  Created by IntelliJ IDEA.
  User: gaoxiang
  Date: 19-12-20
  Time: 上午11:13
-->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" lang="zh">
<!-- BEGIN SIDEBAR -->
<div th:fragment="dva_sidebar" class="page-sidebar-wrapper">
    <!-- BEGIN SIDEBAR -->
    <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
    <!-- DOC: Change data-auto-speed="200" to adjust the sub menu slide up/down speed -->
    <div class="page-sidebar navbar-collapse collapse">
        <!-- BEGIN SIDEBAR MENU -->
        <!-- DOC: Apply "page-sidebar-menu-light" class right after "page-sidebar-menu" to enable light sidebar menu style(without borders) -->
        <!-- DOC: Apply "page-sidebar-menu-hover-submenu" class right after "page-sidebar-menu" to enable hoverable(hover vs accordion) sub menu mode -->
        <!-- DOC: Apply "page-sidebar-menu-closed" class right after "page-sidebar-menu" to collapse("page-sidebar-closed" class must be applied to the body element) the sidebar sub menu mode -->
        <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
        <!-- DOC: Set data-keep-expand="true" to keep the submenues expanded -->
        <!-- DOC: Set data-auto-speed="200" to adjust the sub menu slide up/down speed -->
        <ul class="page-sidebar-menu  page-header-fixed " data-keep-expanded="false" data-auto-scroll="false" data-slide-speed="200" >
            <!-- DOC: To remove the sidebar toggler from the sidebar you just need to completely remove the below "sidebar-toggler-wrapper" LI element -->
            <li class="sidebar-toggler-wrapper hide">
                <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
                <div class="sidebar-toggler">
                    <span></span>
                </div>
                <!-- END SIDEBAR TOGGLER BUTTON -->
            </li>

            <li class="nav-item start sidebar-home" >
                <a href="/home" class="nav-link nav-power">
                    <i class="icon-home"></i>
                    <span class="title">主页</span>
                    <!--<span class="arrow open"></span>-->
                </a>
            </li>

            <th:block shiro:hasRole = "admin">
                <li class="heading">
                    <h3 class="uppercase">超级管理员菜单</h3>
                </li>
                <li>
                    <a href="/permission/page" data-param="&current=1&size=10&parentId=0" class="nav-link nav-power">
                        <i class="fa fa-cogs "></i>
                        <span class="title">权限管理</span>
                    </a>
                </li>
            </th:block>

            <th:block shiro:hasAnyRoles ="admin,manager">
                <li class="heading">
                    <h3 class="uppercase">页面工具</h3>
                </li>

                <li class="nav-item ">
                    <a href="" class="nav-link nav-toggle">
                        <i class="fa fa-cogs "></i>
                        <span class="title">工具集合</span>
                        <span class="arrow "></span>
                    </a>
                    <ul  class="sub-menu fade-in-up">
                        <li class="nav-item">
                            <a href="#" class="nav-link">
                                <span>测试某个url地址：</span>
                                <div>
                                    <input class="form-control" id="urlTest" placeholder="URL:/controller/page">
                                    <div style="margin-top: 5px;">
                                        <button style="width:100%;" class="btn btn-success nav-power" href="" data-param="&current=1&size=10" onclick="$(this).attr('href',$('#urlTest').val())">测试</button>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="javascript:closeNowTab()" class="nav-link">
                                <i class="fa fa-close"></i>
                                <span>关闭当前显示的标签页</span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="javascript:closeAllTab()" class="nav-link">
                                <i class="fa fa-power-off"></i>
                                <span>关闭全部标签页</span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="javascript:refreshNowTab()" class="nav-link">
                                <i class="fa fa-refresh"></i>
                                <span>刷新当前显示的标签页</span>
                            </a>
                        </li>
                    </ul>
                </li>
            </th:block>

            <li class="heading">
                <h3 class="uppercase">菜单</h3>
            </li>
                <li  th:each="data,iterStat : ${session['permissionList']}" class="nav-item">
                    <a th:href="${data['url'] }" th:title="${data['intro'] }" th:data-param="${data['param'] }" th:class="'nav-link nav-toggle ' + ${data['url'] != '' ? 'nav-power':''}">
                        <i th:class="${data['icon']}"></i>
                        <span class="title" th:text="${data['name']}"> 名称 </span>
                        <span class="arrow " th:if="${data['url'] == ''}"></span>
                    </a>
                        <ul class="sub-menu" th:if="${data['url'] == '' }">
                                <li class="nav-item" th:each="data2,iterStat2 : ${data['permissions']}" >
                                    <a th:href="${data2['url'] }" th:title="${data2['intro'] }" th:data-param="${data2['param'] }" th:class="'nav-link nav-toggle ' + ${data2['url'] != '' ? 'nav-power':''}">
                                        <i th:class="${data2['icon']}"></i>
                                        <span class="title" th:text="${data2['name']}"> 名称 </span>
                                        <span class="arrow " th:if="${data2['url'] == ''}"></span>
                                    </a>
                                    <ul class="sub-menu" th:if="${data2['url'] == '' }">
                                        <li class="nav-item" th:each="data3,iterStat3 : ${data2['permissions']}" >
                                            <a th:href="${data3['url'] }" th:title="${data3['intro'] }" th:data-param="${data3['param'] }" th:class="'nav-link nav-toggle ' + ${data3['url'] != '' ? 'nav-power':''}">
                                                <i th:class="${data3['icon']}"></i>
                                                <span class="title" th:text="${data3['name']}"> 名称 </span>
                                            </a>
                                        </li>
                                    </ul>
                                </li>
                        </ul>
                </li>
        </ul>
        <!-- END SIDEBAR MENU -->
        <!-- END SIDEBAR MENU -->
    </div>
    <!-- END SIDEBAR -->
</div>
<!-- END SIDEBAR -->
</html>